package net.hn.hnms.biz.equipment.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import net.hn.hnms.biz.equipment.domain.dto.ProductionStatementDto;
import net.hn.hnms.biz.equipment.domain.vo.ChartOperationRateVO;
import net.hn.hnms.biz.equipment.domain.vo.EquipmentSwitchVo;
import net.hn.hnms.biz.equipment.domain.vo.ProductionStatementVo;
import net.hn.hnms.biz.equipment.service.EquipmentService;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.satoken.config.AutoSetMineCode;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 智呈物联 pan'sx
 * 2022/8/22 11:51
 * 1.0 version
 */
@Api(value = "重大设备首页接口", tags = {"重大设备首页"})
@RestController
@RequestMapping("/equipment/index")
@RequiredArgsConstructor
public class EquipmentIndexController {
    private final EquipmentService equipmentService;
    @GetMapping("switch")
    @ApiOperation("重大设备开关信息")
    public R<List<EquipmentSwitchVo>> equipmentSwitch(){
        return R.ok(equipmentService.equipmentSwitch());
    }

    @GetMapping("operationRate")
    @ApiOperation("生产看板-本月开机率台账")
    public R<ChartOperationRateVO> operationRate(){
        return R.ok(equipmentService.operationRate());
    }

//    @GetMapping("getDeviceType")
//    @ApiOperation("生产看板-获取设备类型")
//    public R<Map<String, String>> getDeviceType() {
//        Map<String, String> stringStringMap = new HashMap<>();
//        stringStringMap.put("0", "采煤");
//        stringStringMap.put("1", "掘进");
//        stringStringMap.put("2", "煤流");
//        stringStringMap.put("3", "立井、斜井提升");
//        stringStringMap.put("4", "通风");
//        stringStringMap.put("5", "压风");
//        stringStringMap.put("6", "排水");
//        stringStringMap.put("7", "瓦斯抽采");
//        stringStringMap.put("8", "制氮");
//        return R.ok();
//    }
    @GetMapping("getProductionStatementBydeviceType")
    @ApiOperation("生产报表-根据生产设备类型获取生产报表")
    @AutoSetMineCode
    public R<List<ProductionStatementVo>> getProductionStatementBydeviceType(ProductionStatementDto productionStatementDto) {
        List<ProductionStatementVo> productionStatementVos= equipmentService.getProductionStatementBydeviceType(productionStatementDto);
        return R.ok(productionStatementVos);
    }


}
